package com.xingda.packing.enums;

/**
 * 质量状态
 * @author LEGION
 *
 */
public enum WheelQualityState {
	//1合格2不合格3待检
	QUALITY(1,"0001B210000000054108", "合格"), 
	DISQUALITY(2,"0001B21000000005410A", "不合格"),
	WAIT_CHECK(3,"0001B210000000058T28", "待检"),
	UNKNOW(-1,"00000000000000000000", "未知");

	private final int code;
	/**
	 * pk编号
	 */
	private final String pk;

	/**
	 * 说明
	 */
	private final String desc;

	WheelQualityState(int code, String pk, String desc) {
		this.code = code;
		this.pk = pk;
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}
	
	public String getPk() {
		return pk;
	}

	public String getDesc() {
		return desc;
	}
	
	public static WheelQualityState getByCode(int code) {
		for(WheelQualityState state:WheelQualityState.values()) {
			if (state.getCode()==code) {
				return state;
			}
		}
		return UNKNOW;
	}

}
